From ae4ac826a90bc4112d98854e397f1abacd3e811e Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Sat, 28 Oct 2023 05:41:58 -0600 Subject: [PATCH] move Qt floor from 5.12 to 5.15 (#1199) * move Qt floor to 5.15. * fix focal, coverage, windows 32 bit builds. * try harder to fix coverage build * fix codeql build * kill fedora 32 CI build which uses Qt 5.14. --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/fedora.yml | 3 --- .github/workflows/ubuntu.yml | 9 +++++---- .github/workflows/windows.yml | 12 ++++++------ CMakeLists.txt | 4 ++-- gui/CMakeLists.txt | 4 ++-- igc.cc | 4 ---- main.cc | 2 +- shape.cc | 4 ---- src/core/logging.h | 13 ------------- tools/ci_install_windows.sh | 6 ++++-- tools/ci_setup_windows.ps1 | 2 +- tools/make_docker_qtio_image | 2 +- tools/travis_install_linux_coverage | 2 +- tools/travis_install_linux_local | 2 +- util.cc | 4 ---- xcsv.cc | 4 ---- 17 files changed, 25 insertions(+), 54 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 98482780a..27efd0025 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -27,7 +27,7 @@ jobs: name: Analyze runs-on: ubuntu-latest container: - image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_focal + image: gpsbabel-docker.jfrog.io/tsteven4/gpsbabel_build_environment_jammy env: CMAKE_GENERATOR: Ninja diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index 6c7388528..76543d9d5 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -13,10 +13,7 @@ jobs: strategy: fail-fast: false matrix: - # version 32, though obsolete, uses Qt 5.14 so we keep it for that. include: - - IMAGE: '32' - CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5' - IMAGE: '35' CMAKE_PREFIX_PATH: '/usr/lib64/cmake/Qt5' - IMAGE: '37' diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2cf8d4331..9a1f92802 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -18,8 +18,9 @@ jobs: fail-fast: false matrix: include: - - IMAGE: 'focal' - SCRIPT: './tools/build_and_test_cmake.sh' + # focal has Qt 5.12, end of standard support 4/2025, end of life 4/2030. + #- IMAGE: 'focal' + # SCRIPT: './tools/build_and_test_cmake.sh' - IMAGE: 'jammy' CMAKE_PREFIX_PATH: '/usr/lib/x86_64-linux-gnu/cmake/Qt5' SCRIPT: './tools/build_and_test_cmake.sh' @@ -63,12 +64,12 @@ jobs: coverage: name: coverage Build - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: install run: | sudo apt-get update - sudo apt-get install gcovr lcov libusb-1.0-0-dev qt5-default qtwebengine5-dev libqt5serialport5-dev ninja-build + sudo apt-get install gcovr lcov libusb-1.0-0-dev qtbase5-dev qtwebengine5-dev libqt5serialport5-dev ninja-build - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4a5a69411..fa003068d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -19,27 +19,27 @@ jobs: fail-fast: false matrix: include: - - QT_VERSION: '5.12.12' + - QT_VERSION: '5.15.2' ARCH: 'amd64' HOST_ARCH: 'amd64' - COMPILER: 'msvc2017_64' + COMPILER: 'msvc2019_64' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' RELEASE: false os: windows-2019 - - QT_VERSION: '5.12.12' + - QT_VERSION: '5.15.2' ARCH: 'amd64' HOST_ARCH: 'amd64' - COMPILER: 'msvc2017_64' + COMPILER: 'msvc2019_64' TOOLSET: 'v141,version=14.16.27023' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' RELEASE: false os: windows-2019 - - QT_VERSION: '5.12.12' + - QT_VERSION: '5.15.2' ARCH: 'x86' HOST_ARCH: 'amd64' - COMPILER: 'msvc2017' + COMPILER: 'msvc2019' METHOD: 'aqt' GENERATOR: 'Visual Studio 16 2019' RELEASE: false diff --git a/CMakeLists.txt b/CMakeLists.txt index eb8badaaa..315137eef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,8 @@ add_executable(gpsbabel) find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core) -if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12) - message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.12 or newer is required.") +if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15) + message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.") else() message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}") endif() diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 97062e8a9..a64f6813a 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -25,8 +25,8 @@ endif() find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED) list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml) -if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12) - message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.12 or newer is required.") +if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.15) + message(FATAL_ERROR "Qt version ${Qt${QT_VERSION_MAJOR}Core_VERSION} found, but version 5.15 or newer is required.") else() message(STATUS "Using Qt${QT_VERSION_MAJOR} version ${Qt${QT_VERSION_MAJOR}Core_VERSION}") endif() diff --git a/igc.cc b/igc.cc index 11b2cfb6f..35fd32f67 100644 --- a/igc.cc +++ b/igc.cc @@ -688,11 +688,7 @@ void IgcFormat::wr_header() // Other header data may have been stored in track description if (track && track->rte_desc.startsWith(HDRMAGIC)) { QString desc = track->rte_desc.mid(QString(HDRMAGIC).size()); -#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) - const QStringList fields = desc.split(HDRDELIM, QString::SkipEmptyParts); -#else const QStringList fields = desc.split(HDRDELIM, Qt::SkipEmptyParts); -#endif for (const auto& field : fields) { gbfprintf(file_out, "%s\r\n", CSTR(field)); } diff --git a/main.cc b/main.cc index f99f47903..21cafdee1 100644 --- a/main.cc +++ b/main.cc @@ -738,7 +738,7 @@ main(int argc, char* argv[]) // MIN_QT_VERSION in GPSBabel.pro should correspond to the QT_VERSION_CHECK // arguments in main.cc and gui/main.cc and the version check in // CMakeLists.txt, gui/CMakeLists.txt. -#if (QT_VERSION < QT_VERSION_CHECK(5, 12, 0)) +#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) #error This version of Qt is not supported. #endif diff --git a/shape.cc b/shape.cc index 318c1a193..42cbe1e57 100644 --- a/shape.cc +++ b/shape.cc @@ -218,11 +218,7 @@ ShapeFormat::read() if (qopt_name.contains('+')) { // form a compound name from one or more fields. nameidx = -2; -#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) - const QStringList opt_name_fields = qopt_name.split('+', QString::SkipEmptyParts); -#else const QStringList opt_name_fields = qopt_name.split('+', Qt::SkipEmptyParts); -#endif nameindices.reserve(opt_name_fields.size()); for (int oidx=0; oidx&2 exit 1 diff --git a/tools/ci_setup_windows.ps1 b/tools/ci_setup_windows.ps1 index 582a84c08..73791c747 100755 --- a/tools/ci_setup_windows.ps1 +++ b/tools/ci_setup_windows.ps1 @@ -7,7 +7,7 @@ # and https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt Param( - [string] $qtdir = "C:\Qt\Qt5.12.10\5.12.10\msvc2017_64", + [string] $qtdir = "C:\Qt\Qt5.15.2\5.15.2\msvc2019_64", [ValidateSet("x86", "amd64")][string] $arch = "amd64", [ValidateSet("x86", "amd64")][string] $host_arch = "amd64", [string] $vcversion diff --git a/tools/make_docker_qtio_image b/tools/make_docker_qtio_image index f8786e3a3..fb1f73cb4 100755 --- a/tools/make_docker_qtio_image +++ b/tools/make_docker_qtio_image @@ -5,7 +5,7 @@ versuffix=_qtio tag=$(date -u +%Y%m%dT%H%M%SZ) -QT_VERSION=5.12.10 +QT_VERSION=5.15.2 QT_VERSION_SHORT=${QT_VERSION//./} QT_CI_PACKAGES="qt.qt5.${QT_VERSION_SHORT}.gcc_64,qt.qt5.${QT_VERSION_SHORT}.qtwebengine" DOWNLOAD_URL=$(./qtci/find_qt_installer ${QT_VERSION}) diff --git a/tools/travis_install_linux_coverage b/tools/travis_install_linux_coverage index 2620ad494..f8ad932e1 100755 --- a/tools/travis_install_linux_coverage +++ b/tools/travis_install_linux_coverage @@ -27,7 +27,7 @@ function validate() { ) } -QT_VERSION=${1:-5.12.2} +QT_VERSION=${1:-5.15.2} QT_VERSION_SHORT=${QT_VERSION//./} # our expectation is that install-qt creates $QTDIR, $QTDIR/bin. diff --git a/tools/travis_install_linux_local b/tools/travis_install_linux_local index 9544a472a..8d15672a0 100755 --- a/tools/travis_install_linux_local +++ b/tools/travis_install_linux_local @@ -27,7 +27,7 @@ function validate() { ) } -QT_VERSION=${1:-5.12.2} +QT_VERSION=${1:-5.15.2} QT_VERSION_SHORT=${QT_VERSION//./} # our expectation is that install-qt creates $QTDIR, $QTDIR/bin. diff --git a/util.cc b/util.cc index 38b464f3e..e1723f533 100644 --- a/util.cc +++ b/util.cc @@ -345,11 +345,7 @@ make_datetime(QDate date, QTime time, bool is_localtime, bool force_utc, int utc result = QDateTime(QDate(1970, 1, 1), time, timespec, offset); } else if (date.isValid()) { // no time, use start of day in the given Qt::TimeSpec. -#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) - result = QDateTime(date, QTime(0,0), timespec, offset); -#else result = date.startOfDay(timespec, offset); -#endif } return result; diff --git a/xcsv.cc b/xcsv.cc index 2794c0f7d..d2c57e549 100644 --- a/xcsv.cc +++ b/xcsv.cc @@ -646,11 +646,7 @@ XcsvFormat::xcsv_parse_val(const QString& value, Waypoint* wpt, const XcsvStyle: case XcsvStyle::XT_GEOCACHE_LAST_FOUND: { QDate date; date = yyyymmdd_to_time(value); -#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) - wpt->AllocGCData()->last_found = QDateTime(date); -#else wpt->AllocGCData()->last_found = date.startOfDay(); -#endif break; } -- 2.30.2